-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to select and launch debug configuration #20979
Conversation
@michelkaporin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @egamma and @alexandrudima to be potential reviewers. |
Hi @michelkaporin, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@ICommandService commandService: ICommandService, | ||
@IWorkspaceContextService contextService: IWorkspaceContextService, | ||
@IFileService fileService: IFileService, | ||
@IQuickOpenService quickOpenService: IQuickOpenService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put private for quickOpenService
return nls.localize('noConfigurationsMatching', "No debug configurations matching"); | ||
} | ||
|
||
return nls.localize('noConfigurationsFound', "No debug configurations found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update label to also contain '. Please create a 'launch.json' file.'
@@ -210,6 +211,28 @@ export class RunAction extends StartAction { | |||
} | |||
} | |||
|
|||
export class LaunchAction extends RunAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extend from abstractdebugAction
} | ||
|
||
public run(): TPromise<any> { | ||
return TPromise.as(this.quickOpenService.show('debug ')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not wrap as promise
@@ -210,6 +211,28 @@ export class RunAction extends StartAction { | |||
} | |||
} | |||
|
|||
export class LaunchAction extends RunAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to SelectAndStartAction, also change the id, nls.id
@@ -127,6 +128,17 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(EnableAllBreakpointsAc | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(DisableAllBreakpointsAction, DisableAllBreakpointsAction.ID, DisableAllBreakpointsAction.LABEL), 'Debug: Disable All Breakpoints', debugCategory); | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(ClearReplAction, ClearReplAction.ID, ClearReplAction.LABEL), 'Debug: Clear Debug Console', debugCategory); | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(FocusReplAction, FocusReplAction.ID, FocusReplAction.LABEL), 'Debug: Focus Debug Console', debugCategory); | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(LaunchAction, LaunchAction.ID, LaunchAction.LABEL, null, CONTEXT_NOT_IN_DEBUG_MODE), 'Debug: Launch Configuration', debugCategory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove null and context for now
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer 'use strict', this is simply ignored
import * as errors from 'vs/base/common/errors'; | ||
|
||
class DebugEntry extends Model.QuickOpenEntry { | ||
private debugService: IDebugService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of this privates
return false; | ||
} | ||
// Run selected debug configuration | ||
this.debugService.createProcess(this.configurationName).done(undefined, errors.onUnexpectedError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do it the other way around
|
||
public getResults(input: string): TPromise<Model.QuickOpenModel> { | ||
const configurationNames = this.debugService.getConfigurationManager().getConfigurationNames() | ||
.sort((a, b) => a.localeCompare(b)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not sort
Looks good, merging in 🍻 |
Adds 'debug' keyword similar to 'task' and 'git' to command palette.
Fixes #16613.